#include "download.h"

#include "http_download.h"

std::unique_ptr<Downloader> Downloader::create(const std::string& url, ThreadPool& download,
                                               ThreadPool& writeDisk)
{
    if (url.find("http://") == 0 || url.find("https://") == 0)
    {
        return std::unique_ptr<HttpDownloader>(new HttpDownloader(download, writeDisk));
    }
    else if (url.find("ftp://") == 0)
    {
        // return std::make_unique<FtpDownload>();
    }
    throw("unsupport protocol");
}